<template>
	<view id="certificationMoney">
		<Header txt="" v-if="baidu"></Header>
		<HeaderB txt="" v-if="!baidu"></HeaderB>
		<view class="warring_txt02">
		      注：我将向梦琪科技的对公账户转入已生成的金额，打款成功后点击确认按钮
		</view>
		<view class="center">
			<view class="item">
				<text>打款账户名</text>
				<view class="input">{{cert.business}}</view>
			</view>
			<view class="item">
				<text>打款账号</text>
				<view class="input">{{cert.bankAccount}}</view>
			</view>
			<view class="item">
				<text>到款账户名</text>
				<view class="input">杭州市梦琪科技有限公司</view>
			</view>
			
			<view class="item">
				<text>到帐银行</text>
				<view class="input">
					中国工商银行
				</view>
			</view>
			<view class="item">
				<text>到账账号</text>
				<view class="input">
					120220580990007634
				</view>
			</view>
			<view class="item">
				<text>请按照已生成的金额进行打款</text>
				<view class="input">
					{{cert.transfer}}
				</view>
			</view>
			<button type="primary" @click="submitSert">确定打款</button>
		</view>		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				cert:{
					bankAccount:''
				},
				account_num:'',
				numberverifyCount:'',
				baidu:true
			}
		},
		onShow(){
			this.getPersonalCertify()
			this.verifyCount()
			// #ifdef MP-BAIDU
			this.baidu=false
			// #endif
		},
		methods: {
			submitSertRe() {
			      let that = this;
				  uni.showModal({
				      title: '此操作将删除原有认证信息',
				      content: '是否继续?',
				      success: function (res) {
				          if (res.confirm) {
				             this.$store
				               .dispatch("AgainCetify")
				               .then((response) => {
				             	if(response.data.code==0){
				             		let data = response.data.obj;
				             		that.cert = data;			
				             	}
				               })
				               .catch(() => {}); 
				          } else if (res.cancel) {
				              console.log('用户点击取消');
				          }
				      }
				  });
			      this.$dialog.confirm({
			        mes: "此操作将删除原有认证信息, 是否继续?",
			        opts: () => {
			          againCetify().then((response) => {
			            let data = response;
			            if (data.code == "0") {
			              that.$router.push("/certInput");
			            } else {
			              this.$message({
			                showClose: true,
			                message: data.msg,
			                type: "error",
			              });
			              return false;
			            }
			          });
			        },
			      });
			},
			getPersonalCertify(){
				let that = this;
				this.$store
				  .dispatch("BusinessCetifyGet")
				  .then((response) => {
					if(response.data.code==0){
						let data = response.data.obj;
						that.cert = data;			
					}
				  })
				  .catch(() => {});
			},
			verifyCount(){
				let that = this;
				this.$store
				  .dispatch({
					  type:"verifyCount",
					})
				  .then((response) => {
					if(response.data.code==0){
						let data = response.data.obj;
						that.numberverifyCount = data;			
					}
				  })
				  .catch(() => {});
			},
			submitSert(){
				let that = this;
				this.$store
				  .dispatch({
					  type:"UserPaid",
					})
				  .then((response) => {
					  console.log(response);
					if(response.data.code==0){
						this.verifyCount()
						uni.navigateTo({
							url: "/pagesA/user/certIput"
						})
					}else{
						this.verifyCount()	
						this.$store.commit("SET_ERRORINFORMATION", {
						  mes: response.data.msg,
						  icon: "error",
						});
					}
				  })
				  .catch(() => {});
			}
		}
	}
</script>

<style lang="less">
#certificationMoney{
	width: 1005;
	.warring_txt02{
		text-align: left;
		background-color: #ffefe2;
		color: #f28832;
		padding: 20rpx;
		font-size: 24rpx;
	}
  .center{
	  width: 92%;
	  margin: 0 auto;
  }
	.item{
		margin-top: 20rpx;
	}
	.input{
		height: 80rpx;
	    font-size:30rpx;
	    color: #666666;
	    line-height: 80rpx;
		border-bottom: 2rpx solid #e4e5ed;
	}
	.input2{
		height: 80rpx;
		font-size:30rpx;
		color: #666666;
		line-height: 80rpx;
	}
	button{
		margin-top: 50rpx;
		width: 80%;
	}
}
</style>

